package main

import "fmt"

type Point struct {
	X, Y float64
}

func (p *Point) ScaleBy(factor float64) {
	p.X = factor
	p.Y = factor
}

func main() {
	p1 := &Point{1, 2}
	p1.ScaleBy(2)
	fmt.Println(*p1) // "{2, 4}"
	fmt.Println("--------------------------")

	p2 := Point{1, 2}
	pptr := &p2
	pptr.ScaleBy(2)
	fmt.Println(p2)

	fmt.Println("--------------------------")

	p3 := Point{1, 2}
	(&p3).ScaleBy(2)
	fmt.Println(p3) // "{2, 4}"
	fmt.Println("--------------------------")

}
